import os, sqlite3, logging
from Tkinter import *

class TKView:
    def __init__(self,pid,env):
        self.pid = pid
        self.env = env
        self.root = Tk()
        self.toolbar = Frame(self.root)
        self.toolbar.pack(side=TOP, fill=X)

        self.badd = Button(self.toolbar, text="Add", 
            command=self._add)
        self.badd.pack(side=LEFT)

        self.brem = Button(self.toolbar, text="Remove",
            command=self._rem)
        self.brem.pack(side=LEFT)


    def _add(self, *args):
        logging.debug(str(args))

    def _rem(self, *args):
        logging.debug(str(args))
        

def Run(pid,env):
    tv = TKView(pid,env)
    mainloop()

if __name__ == "__main__":
    env = {}
    env['PORT'] = 6899
    env['CONFIGDIR'] = '~/.config/'
    env['CONFIGLOC'] = 'ffshare'
    env['DBNAME'] = 'files.db'
    env['DOWNLOADTO'] = '~/Dekstop/'
    env['DBTABLE'] = env['CONFIGLOC']+'_files'
    env['SELECT_ALL_PATHS'] = 'select path from ' + env['DBTABLE'] + ';'
    Run(0, env)
